package br.com.site.actions;



import br.com.site.model.dao.DAOException;

import br.com.site.model.entity.Usuario;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.validator.annotations.*;


import java.text.SimpleDateFormat;  
import java.util.Date;  
 

import org.apache.struts2.convention.annotation.Actions;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Action;






@ParentPackage( value = "default")
public class Logout extends ActionSupport {
	  private static final long serialVersionUID = -300519118088286674L;  
	
	@Actions({ 	 
	@Action(value="/logout", 
				   results={@Result(location = "login.jsp", name=SUCCESS)							
							}),
	@Action(value="/logoutFeira",						
		results={@Result(location = "controle/loginvisitante.jsp", name=SUCCESS)})							
							
	})
				
	     public String execute(){
			ActionContext.getContext().getSession().remove("usuario");	
	     	addActionMessage("Logout efetuado com sucesso.");
			return SUCCESS;
		}  
	   
	 
}
